import { createSlice, PayloadAction } from "@reduxjs/toolkit";

export interface WangEditorState {
	showCodeModal: boolean;
	value: string;
}

const initialState: WangEditorState = {
	showCodeModal: false,
	value: "",
};

export const wangEditorSlice = createSlice({
	name: "wangEditor",
	initialState,
	reducers: {
		setShowCodeModal: (state, action: PayloadAction<boolean>) => {
			state.showCodeModal = action.payload;
		},
	},
});

export const { setShowCodeModal } = wangEditorSlice.actions;
export const wangEditorReducer = wangEditorSlice.reducer;
